<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>组件的语法糖注册方式</title>
	</head>
	<body>
		<div id="app">
			<cpn></cpn>
			<cpn2></cpn2>
		</div>
		<script src="../vue.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			//1.全局组件语法糖
			Vue.component('cpn',{
				template:`
					<div>
						<h2>这是标题1</h2>
						<p>这是内容，全局组件1</p>
					</div>
				`
			});
			const app = new Vue({
				el: '#app',
				data: {
					message: 'hello'
				},
				components:{
					'cpn2':{
						template:`<div>局部组件1<cpn3></cpn3></div>`,
						components:{
							'cpn3':{
								template:`<div>局部组件2</div>`
							}
						}
					},
					
				}
			});
		</script>
	</body>
</html>
